import React from 'react'

import { AppstoreOutlined, MailOutlined, SettingOutlined } from '@ant-design/icons';

const ICON_COMPONENT_MAP = {
  AppstoreOutlined,
  MailOutlined,
  SettingOutlined
};

// 定义默认图标，当找不到对应图标时使用
const DefaultIcon = () => <span style={{ width: 16, display: 'inline-block' }} />;

const MenuItemIcon = ({name}) => {
  const IconComponent = ICON_COMPONENT_MAP[name] || DefaultIcon;
  return <IconComponent />
}

export default MenuItemIcon;